/**
 * <p>Copyright:Copyright(c) 2019</p>
 * <p>Company:Professional</p>
 * <p>Package:ces.org.course.controller</p>
 * <p>File:FileController.java</p>
 * <p>类更新历史信息</p>
 * @todo chanlong(陈龙) 创建于 May 17, 2019 3:08:28 PM
 */
package ces.org.course.cescoursecuixiaowei.controller;

import ces.org.course.api.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * <p>描述: </p>
 * <p>Company: Professional</p>
 * @author chanlong(陈龙)
 * @date May 17, 2019 3:08:28 PM
 * @version 1.0.2019
 */
@RestController @RequestMapping("/file")
public class FileController {

	@PostMapping
	public String upload(final MultipartFile file) {
		try {
			return service.upload(file);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	
	@Autowired
	private FileService service;
}
